﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RSM.Business
{
    public class ExporterManager
    {
        ContentManager cm = null;
        PageLayoutManager pm = null;
        XmlGenerator xm = null;
       
        public ExporterManager()
        {
            cm = new ContentManager();
            pm = new PageLayoutManager();
            xm = new XmlGenerator();
        }
        public List<Fields> GetContentTypeFields(string contentTypeName)
        {
            List<Fields> fields = null;
            try
            {
                fields = cm.GetContentTypeFields(contentTypeName);
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            return fields;
        }
        public void CreatePageLayout(string pageLayoutName, List<Fields> selectedFields)
        {
             try
            {
            pm.CreatePageLayout(pageLayoutName, selectedFields);
            }
             catch (Exception ex)
             {
                 Logger.LogException(ex);
             }
        }
        public List<Fields> GenerateXml(string columnFeature, string contentFeature, string colDesc, string contentDesc, string colScope, string conScope)
        {

            List<Fields> fileds = null;
            try{

             fileds = xm.GenerateXml(columnFeature, contentFeature, colDesc, contentDesc, colScope, conScope);
             }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }

            return fileds;
        }
    }
}
